<?php

function loadModule($action = array("mod" => "home", "task"=>"main")){
    $urlModule = "module/".$action["mod"]."/".$action["mod"].".".SECION.".php";
    require_once($urlModule);
    $task = $action["task"];
    $runMethod =  $action["mod"]."_run";
    call_user_func($runMethod, $task);
}

function loadTemplate($templateName = 'main', $dataPut=null){
    $mod = (isset($_GET["mod"]) && $_GET["mod"] != null) ?$_GET["mod"]:"home";
    $urlTemplate = "view/".SECION."/".$mod."/".$templateName.".php";
    if(count($dataPut) > 0)
        extract($dataPut);

    loadHeader();
    loadSlideBar();
    require_once($urlTemplate);
    loadFooter();
}

function loadHeader(){

    require_once("view/".SECION."/widget/header.php");
}

function loadSlideBar(){

    require_once("view/".SECION."/widget/sidebar.php");
}

function loadFooter(){

    require_once("view/".SECION."/widget/footer.php");
}

function uriStatic($styleUri){
    return getBaseUrl()."view/".SECION."/widget".$styleUri;
}

?>
